package org.example;

import java.awt.*;
import java.awt.event.KeyEvent;
import java.io.File;

/**
 * Hello world!
 *
 */
public class App2
{
    public static void main( String[] args )
    {
        /*每隔一秒 按下键盘上的 R 键*/
        try {
            Thread.sleep(5000);
            Robot robot = new Robot();
            for (int j = 0; j < 5; j++) {
                for (int i = 0; i < 16; i++) {
                    robot.keyPress(KeyEvent.VK_R);
                    robot.delay(100);
                    robot.keyRelease(KeyEvent.VK_R);
                    robot.delay(3300);
                }
                /*按住S*/
                robot.keyPress(KeyEvent.VK_S);
                robot.delay(500);
                /*按住K*/
                robot.keyPress(KeyEvent.VK_K);
                robot.delay(100);
                /*释放S*/
                robot.keyRelease(KeyEvent.VK_S);
                robot.delay(100);
                /*释放K*/
                robot.keyRelease(KeyEvent.VK_K);
                robot.delay(100);
            }
        } catch (AWTException e) {
            throw new RuntimeException(e);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
